package com.dhcc.cdc.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.stream.Collectors;

public class CommonSrv {
    static Logger log = LoggerFactory.getLogger(CommonSrv.class);

     /**
     * 按照组织ID过滤业务数据（按院区过滤）
     */
    public static List<? extends ICdcDataSrv> filtByOrgId(List<? extends ICdcDataSrv> list, String orgId) {
        if ((orgId != null) && (orgId != "")) {
            Long organizationId = Long.parseLong(orgId);
            list = list.stream().filter((ICdcDataSrv e) -> e.getOrganizationId() == organizationId).collect(Collectors.toList());
        }
        return list;
    }
}
